package com.tz.se.day01;

import java.util.Scanner;

public class SH {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		System.out.println("请输入菱形行列数n(n为奇数)：");
		int n=sc.nextInt();
		if (n% 2 == 0) {
			System.out.println("请输入奇数：");
		} else {
			for (int i = 1; i <= n; i++) {
				for (int j = 1; j <= n; j++) {
					if (i < (n + 1) / 2) {
						if (j == (n + 1) / 2 - i + 1 || j == (n + 1) / 2 + i - 1) {
							System.out.print("*");
						} else {
							System.out.print(" ");
						}
					} else if (i > (n + 1) / 2) {
						if (j == i - (n + 1) / 2 + 1 || j == 3 * (n + 1) / 2 - i - 1) {
							System.out.print("*");
						} else {
							System.out.print(" ");
						}
					} else {
						if (j % 2 != 0) {
							System.out.print("*");
						} else {
							System.out.print(" ");
						}
					}
				}
				System.out.println();
			}
		}
		sc.close();
	}
}
